package main;

import java.rmi.RemoteException;

import org.omg.CORBA.ORB;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;

import embeded.impl.EmbededObjectImpl;

public class main_embeded {
	ORB orb = null;
	POA poa = null;

	public main_embeded(String[] args) {
		orb = ORB.init(new String[]{}, null);
		new Thread(new Runnable() {
			public void run() {
				orb.run();
			}
		}).start();
		try {
			poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
			poa.the_POAManager().activate();

		} catch (Exception e) {
			System.out
					.println("EmbededObjectImpl : erreur d'activation du poa !!!");
			return;
		}
		try {
			EmbededObjectImpl embeded = new EmbededObjectImpl("embeded2", orb, poa);
		} catch (RemoteException e) {
			System.out.println("Main");
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new main_embeded(args);
	}

}
